import React from 'react';
import { Toast } from 'antd-mobile';

export default class Index extends React.Component {
    constructor(props){
        super(props)
        this.state={
            id: props.match.params.id,
            data: [],
        }
    }
	componentDidMount(){
        document.title = this.props.match.params.name
        this.getList()
    }
    getList(){
        global.Ajax.hhtc_request("service/service_list",{id: this.state.id}).then(data=>{
			if(data.code===1){
				this.setState({
                    data: data.data.data
                })
			}
		})
    }
	render(){
		return(
            <div className='sign_index_list' style={{'padding':0}}>
                {this.state.data.map((item,index)=>{
                    if (item.is_cont == 1) {
                        return(
                            <div key={'list'+index} className='item' onClick={()=>{this.props.history.push('/page/home/home/servicedetail/'+item.id)}}>
                                <img alt='' src={item.img} className='pic' style={{height:'auto'}} />
                            </div>
                        )
                    }
                    else {
                        return(
                            <div key={'list'+index} className='item'>
                                <img alt='' src={item.img} className='pic' style={{height:'auto'}} />
                            </div>
                        )
                    }
                })}
            </div>
		)
	}
}
